import { Button } from "@/components/ui/button"; import { Link } from "waku"; import { getContextData } from "waku/middleware/context"; import type { PageProps } from "waku/router"; import db from "@/lib/db"; import { Progress } from "@/components/ui/progress"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; const flags: Record = { th: "🇹🇭", en: "🇬🇧", zh: "🇨🇳", ja: "🇯🇵", es: "🇪🇸", fr: "🇫🇷", }; export default async function HomePage(props: PageProps<"/lang/[slug]">) { const lessons = await getData(props.slug); const { user } = getContextData(); function commit() {} return ( <>

Thai!

{lessons.map((l) => (

{l.name}

{l.description}

))}
); } const getData = async (lang: string) => { const lessons = db.fetchLanguage(lang); return lessons; }; export const getConfig = async () => { return { render: "dynamic", } as const; }; async function LanguageItem({ lang }: { lang: string }) { return (
{flags[lang] || ""}
); }